
let arr: number[] = [1, 2, 3]
console.log(arr);

let brr: Array<number> = [1, 2, 3]
console.log(brr);

function greet(name: string): number {
  console.log(name);
  return 10000
}
[1, 2, 3].forEach(s => console.log(s))
function delect(obj: { x: number, y?: string }) {
  console.log(typeof obj.x, typeof obj.y);
}
delect({ x: 1, y: '1000' })
delect({ x: 1 })

let id: number | string = '0001'
function getId(id: string | number) {
  if (typeof id === 'string') {
    console.log(id.toUpperCase());
  } else {
    console.log(id);
  }
}
function c(x: string | Array<string>) {
  if (Array.isArray(x)) {
    console.log(x.join(' and '));
  } else {
    console.log(x);
  }
}
c(['1', 'asvsa'])
